
#include "vm.h"

using namespace Common;

/**** Interpreter Macros ****/

#define ASSERT_OPERANDS(op, a, b) \
	if((op).operandAType != a || (op).operandBType != b){ throw ExInvalidOperand() }

void VirtualMachine::Execute(IProgram * pProgram, Context * pContext) {
	IProgram::tElement * zProg = pProgram->getElements();
	using Instruction;

	for(int i = 0; i < pProgram->getNumElements(); i++) {
		switch(zProg[i].op.opcode) {
			case Opcode::COPY:
				ASSERT_OPERANDS(zProg[i].op, REG, REG);

	};
};

